home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
dev
/
lang
/
uc_0_30.lha
/
u
/
rdocs
/
r0003.doc
< prev
next >
Wrap
Text File
|
1996-10-30
|
4KB
|
152 lines
**********************
* P R O J E C T < U >
*
* Author and copyright
* (c) 1996
* Paul van der Valk
*
* file: r0003.doc
* last updated: 30-oct-96
AN INTRODUCTION TO UCODE
1. The basic idea
-----------------
The U-Project - short 'U' - is a programming environment built
around a single universal code definition. This code definition
is very strict. The tools that are built around this definition
are however completely free-form - they can implement any subset
of the original definition, in any desired implementation, on any
platform.
The purpose of such universal code definition, named "UCode",
is to seperate the functionality of a given entity (a program,
a subroutine, a dataset, ...) from it's actual implementation.
In schematic form:
--> implemantation 1
|
UCode -----> implementation 2
|
--> ................
|
--> implementation N
There are many sorts of implementations possible. Consider:
- A 68K code generator.
- A PPC code generator.
- A C code generator.
- PASCAL code generator.
- A whatever programming language code generator, with a
specific implementation flavour. For example, an abstract
GUI written in UCode could translate to an Amiga specific
program (C/E/68k...) using MUI, BGUI, EAGUI, Triton, ...
- A visualizer, presenting the program flow or module
layout (functions, datatypes, ...) in an ascii or a
graphical based display.
- An anaylyzer/optimizer, checking for unused variables,
multiple instances of constant (string) data, or
code-fragments...
- An executer, or interpreter if you prefer. The UCode
could be executed in whatever required environment. Text
output could be send to a console, or a dynamic HTML
document in a browser.
- A tracer/debugger.
- ...
These backends are relatively easy to implement because the UCode is
defined in a binary format, based on linked records. A typcial UCode
'applications' consists of nested trees, which is quite usable for
(source/object) code generation and analysis.
2. Extending the concept
------------------------
Because human beings (normally :-)) don't deal with binary code,
some sort of frontend is required to generate the UCode. There
are a number of such frontends imaginable:
- A procedural language of some sort, or possibly an existing
language.
- A higer level OO-ish language.
- Binary data from say a paint-program (to be used as inline
constant data).
- A 'visual' UCode editor.
- ...
Since we already had several possible backend implementations, the
UCode falls in place between N frontends and M backends:
frontend 1 -- --> backend 1
| |
frontend 2 -----> UCode ------> backend 2
| |
.......... -- --> .........
| |
frontend N -- --> backend N
Obvious afvantages of such scheme are:
- A high degree of portability.
- Re-usable frontends/backends. For example, a good 68k generator
needs to be written only once. By providong a C and a PASCAL
frontend, you end up with a good C compiler and a good PASCAL
compiler :)
- A high abstraction level. Text/graphics code for example
has a strict defined behaviour, but an unknown actual
implementation. It's up to the backend...
- A highly extendible environment.
Current and future state of the project
---------------------------------------
UCode implementations are currently available for AmigaOS only.
Only one beta-frontend (uca2b) and one beta-backend (umgk) are
publicly available. A procedural language frontend (ucp2b) is
under development. A 68k backend is under consideration, amongst
other things.
UCode is open to implementation by anyone (please read r0002.doc;
dislaimer and copyright). Since I don't have the time nor the
knowledge to develop a wide range of front/backends, I encourage
interested parties to develop their own implementations. You
can mail me (address below) for related info.
Paul van der Valk
poing@luna.nl